# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Solar.V1.Model.FinancialDetails do
  @moduledoc """
  Details of a financial analysis. Some of these details are already stored at higher levels (e.g., out of pocket cost). Total money amounts are over a lifetime period defined by the panel_lifetime_years field in SolarPotential. Note: The out of pocket cost of purchasing the panels is given in the out_of_pocket_cost field in CashPurchaseSavings.

  ## Attributes

  *   `costOfElectricityWithoutSolar` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Total cost of electricity the user would have paid over the lifetime period if they didn't install solar.
  *   `federalIncentive` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Amount of money available from federal incentives; this applies if the user buys (with or without a loan) the panels.
  *   `initialAcKwhPerYear` (*type:* `number()`, *default:* `nil`) - How many AC kWh we think the solar panels will generate in their first year.
  *   `lifetimeSrecTotal` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Amount of money the user will receive from Solar Renewable Energy Credits over the panel lifetime; this applies if the user buys (with or without a loan) the panels.
  *   `netMeteringAllowed` (*type:* `boolean()`, *default:* `nil`) - Whether net metering is allowed.
  *   `percentageExportedToGrid` (*type:* `number()`, *default:* `nil`) - The percentage (0-100) of solar electricity production we assumed was exported to the grid, based on the first quarter of production. This affects the calculations if net metering is not allowed.
  *   `remainingLifetimeUtilityBill` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Utility bill for electricity not produced by solar, for the lifetime of the panels.
  *   `solarPercentage` (*type:* `number()`, *default:* `nil`) - Percentage (0-100) of the user's power supplied by solar. Valid for the first year but approximately correct for future years.
  *   `stateIncentive` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Amount of money available from state incentives; this applies if the user buys (with or without a loan) the panels.
  *   `utilityIncentive` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Amount of money available from utility incentives; this applies if the user buys (with or without a loan) the panels.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :costOfElectricityWithoutSolar => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :federalIncentive => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :initialAcKwhPerYear => number() | nil,
          :lifetimeSrecTotal => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :netMeteringAllowed => boolean() | nil,
          :percentageExportedToGrid => number() | nil,
          :remainingLifetimeUtilityBill => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :solarPercentage => number() | nil,
          :stateIncentive => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :utilityIncentive => GoogleApi.Solar.V1.Model.Money.t() | nil
        }

  field(:costOfElectricityWithoutSolar, as: GoogleApi.Solar.V1.Model.Money)
  field(:federalIncentive, as: GoogleApi.Solar.V1.Model.Money)
  field(:initialAcKwhPerYear)
  field(:lifetimeSrecTotal, as: GoogleApi.Solar.V1.Model.Money)
  field(:netMeteringAllowed)
  field(:percentageExportedToGrid)
  field(:remainingLifetimeUtilityBill, as: GoogleApi.Solar.V1.Model.Money)
  field(:solarPercentage)
  field(:stateIncentive, as: GoogleApi.Solar.V1.Model.Money)
  field(:utilityIncentive, as: GoogleApi.Solar.V1.Model.Money)
end

defimpl Poison.Decoder, for: GoogleApi.Solar.V1.Model.FinancialDetails do
  def decode(value, options) do
    GoogleApi.Solar.V1.Model.FinancialDetails.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Solar.V1.Model.FinancialDetails do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
